// import bodyParser from 'body-parser'
// import session from 'express-session'

export default {
  mode: 'universal',
  /*
  ** Headers of the page
  */
  head: {
    title: '酷音运营管理后台',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#00f' },
  /*
  ** Global CSS
  */
  css: [
    'iview/dist/styles/iview.css'
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/iview',
    '@/plugins/axios',
    // '@/plugins/filters'
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios'
  ],
  /*
  ** Axios module configuration
  ** See https://axios.nuxtjs.org/options
  */
  axios: {
    proxy: true,
    credentials: true
  },

  proxy: {
    '/bm/': {
      // target: 'http://192.168.1.25:8080',
      target: 'http://app.w3cstudy.cc',
      pathRewrite: {
        changeOrigin: true
      }
    },
    '/app/': {
      // target: 'http://192.168.1.25:8080',
      target: 'http://app.w3cstudy.cc',
      pathRewrite: {
        changeOrigin: true
      }
    }
    // '/bm/': 'http://192.168.1.24:8080'
  },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    extend(config, ctx) {
    }
  },
  // serverMiddleware: [
  //   // body-parser middleware
  //   bodyParser.json(),
  //   // session middleware
  //   session({
  //     secret: 'super-secret-key',
  //     resave: false,
  //     saveUninitialized: false,
  //     cookie: { maxAge: 60000 }
  //   }),
  //   // Api middleware
  //   // We add /api/login & /api/logout routes
  //   '~/api'
  // ]
}
